{% extends 'news/base.html' %}

{% load i18n markup components comments_tags %}

{% block title %}{{ obj }} | {{ block.super }}{% endblock %}

{% block content_class %}blog-detail{% endblock %}

{% block content %}
    <!--begin primary-column-->
    <article class="entry-post">
        <header class="entry-header">
            <h1>{{ obj }}</h1>
            <div class="byline">
                <i class="fa fa-clock-o"></i> <abbr class="published" title="{{ obj.created|date:'DATETIME_FORMAT' }}">{{ obj.created|date:'DATE_FORMAT' }}</abbr> &nbsp;&nbsp;
                <a href="{{ obj.get_absolute_url }}#comments">
                    <i class="fa fa-comment"></i>
                    {% with comments_count=obj|get_comment_count %}
                        {% blocktrans count counter=comments_count %}{{ counter }} comment{% plural %}{{ counter }} comments{% endblocktrans %}
                    {% endwith %}
                </a>
            </div>
            <div class="entry-meta">
                <i class="fa fa-folder-open"></i> <a href="{% url 'news:index' %}">{% trans "News" %}</a>
                {% if user.is_superuser %}
                <a class="pull-right" href="{% url 'admin:news_news_change' obj.pk %}">
                    <i class="fa fa-pencil"></i> {% trans "Edit" %}
                </a>
                {% endif %}
            </div>

            <!--add this share buttons for mobile viewers-->
            {% include '_addthis.html' %}
        </header>
        <!--end entry-header-->

        <div class="entry-content">
            {{ obj.content|markdown:"safe" }}

            {% if obj.link %}
                <br>
                {% trans "Full version:" %} <a href="{{ obj.link }}">{{ obj.link }}</a>
            {% endif %}
        </div>
        <!--end entry-content-->

        <footer class="entry-footer">
            {{ obj.created|pretty_date:'blog' }}

            {% include '_addthis.html' %}
        </footer>
        <!--end entry-footer-->

    </article>
    <!--end entry-post -->

    <div class="entry-pagination">
        <ul class="pager">
            {% with prev=obj.get_prev %}
                {% if prev %}<li><a href="{{ prev.get_absolute_url }}">← {% trans "older"|capfirst %}</a></li>{% endif %}
            {% endwith %}
            {% with next=obj.get_next %}
                {% if next %}<li><a href="{{ next.get_absolute_url }}">{% trans "newer"|capfirst %} →</a></li>{% endif %}
            {% endwith %}
        </ul>
        <!--close pager-->
    </div>

    {% render_comment_list_with_form obj %}
{% endblock %}